<template>
  <el-dialog title="新增学科" :visible.sync="showDialog" center>
    <!-- 表单内容 -->
    <el-form ref="form" :model="form">
      <el-form-item>
        <el-radio-group v-model="form.chkState">
          <el-radio :label="1">通过</el-radio>
          <el-radio :label="2">拒绝</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item>
        <el-input
          type="textarea"
          :rows="3"
          placeholder="请输入审核意见"
          v-model="form.chkRemarks"
        >
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" size="mini" @click="submit">确定</el-button>
        <el-button size="mini" @click="cancel">取消</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
import { choiceCheck } from '@/api/hmmm/questions.js'
export default {
  data () {
    return {
      showDialog: false,
      form: {
        chkRemarks: '',
        id: 0,
        chkState: 1
      }
    }
  },
  methods: {
    async submit () {
      try {
        await choiceCheck(this.form)
        this.$message.success('操作成功!')
        this.cancel()
        this.$parent.renderTable()
      } catch (error) {
        console.log(error)
      }
    },
    cancel () {
      this.$refs.form.resetFields()
      this.showDialog = false
    }
  }
}
</script>

<style scoped lang="less"></style>
